<?php

	/* 
		check to make sure user is logged in,
		if so, add more (afk) time, if not 
		send them back to login.  No crash check on afk, as it shoul already
		be set when they logged in.
	*/
	
	if(isset($_SESSION['loggedin'] && $_SESSION['loggedin']))
	{
		/* They are logged in, are they afk? */
		if(time() > $_SESSION['afk'])
		{
			
			header('location:afk.php');// this way allows for a custom screen
			die();
		}
		else
		{
			/* update new afk */
			$_SESSION['afk'] = $settings['playersettings']['afk'] + time();

		}
	}
	else
	{
		/* not logged in, send them home */
		header('location:index.php');
		die();
	}

?>